package jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.File;
import java.io.IOException;

/**
 * @Author 汤舒青
 * @Version 1.0
 */


public class JsoupTest {
    public static void main(String[] args) {
        File file = new File("C:\\Users\\Dell\\Desktop\\bdqn.html");
        try {
            Document doc = Jsoup.parse(file, "utf-8");
//            Elements allElements = parse.getAllElements();
//            System.out.println(allElements);
//            Element content = parse.getElementById("content");
//            Elements link = content.getElementsByTag("a");
//            System.out.println(">>>>>>>>>>>>>>>>>>");
//            for (Element element : link) {
//                String href = element.attr("href");
//                String text = element.text();
//            }
            Elements script = doc.getElementsByTag("script");
            for (Element element : script) {
                System.out.println(element.attr("src"));
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
